package com.ysd.twocrm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ysd.twocrm.entity.Leavetable;
import com.ysd.twocrm.mapper.LeavetableMapper;
import com.ysd.twocrm.service.LeaveTableService;
import com.ysd.twocrm.utils.LayuiUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LeaveTableServiceImpl implements LeaveTableService {
    @Autowired
    private LeavetableMapper leavetableMapper;
    @Override
    public LayuiUtils<Leavetable> LEAVETABLE_LAYUI_UTILS(Integer page,Integer Lstatus) {
        Page<Leavetable> leavetablePage=new Page<Leavetable>(page,10);
        QueryWrapper<Leavetable> queryWrapper=new QueryWrapper<Leavetable>();
        queryWrapper.eq("lstatus",Lstatus);
        Page<Leavetable> leavetablePage1 = leavetableMapper.selectPage(leavetablePage, queryWrapper);
        LayuiUtils<Leavetable> leavetableLayuiUtils=new LayuiUtils<>();
        leavetableLayuiUtils.setCount(leavetablePage1.getTotal());
        leavetableLayuiUtils.setData(leavetablePage1.getRecords());
        return leavetableLayuiUtils;
    }
}
